using System;
using System.Collections.Generic;
using System.IO;
using System.IO.Compression;
using System.Text;
using virtuaPol.Model;
using virtuaPol.Util;
using virtuaPol.Main;

namespace virtuaPol.vpTest
{
    class TestDecompressWorldFile : ITestCase
    {
        private string report = "";
        private CWorld world;
        private int numIterations;

        public TestDecompressWorldFile(int iterations)
        {
            numIterations = iterations;
        }

        public void initialize()
        {
            
        }

        public bool execute()
        {
            report += "Load compressed worldfile.\n";
            bool success = WorldLoader.load(out world, "test.vpw");
            if (world != null)
            {
                success = success && world.Countries.Count == numIterations;
                success = success && world.Countries[0].Persons.Count == numIterations;
            }
            return success;
        }

        public void cleanup()
        { }

        public string getReport()
        {
            return report;
        }
    }
}
